home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14248 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Help me with "time --> int"
  5. Date: 12 Apr 1996 11:45:49 -0700
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4km8ctINNlm@keats.ugrad.cs.ubc.ca>
  8. References: <316E5672.773E@uniag.sk>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <316E5672.773E@uniag.sk>, FVS PEF  <fvspef@uniag.sk> wrote:
  12. >Sorry for stupid question, but:
  13. >"Can you help me, what is the easiest way to get day of the month and 
  14. >number of month (1-12) into integer ? 
  15. >
  16. >I studied localtime, but without any success.
  17.  
  18. What exactly did you study about localtime()? You must have overlooked its
  19. return value, which is a pointer to a structure (struct tm *) that gives you a
  20. broken down date. 
  21.  
  22. One of its fields is an integer member (tm_month) representing the month of the
  23. year. Alas, is is 0 to 11 not 1 to 12, but I leave that as an exercise...
  24.  
  25. >                                                    steve
  26. >
  27. >PS : Please, use my e-mail : billik@sun.uniag.sk
  28. >PS1: SunOS 5.4
  29.  
  30. You mean, ``Solaris''. :)
  31. -- 
  32.  
  33.